@echo off
echo Building project...

:: 设置JAVA_HOME
set "JAVA_HOME=D:\java"
set "PATH=%JAVA_HOME%\bin;%PATH%"

echo Using JAVA_HOME: %JAVA_HOME%

:: 验证Java安装
java -version
if %errorlevel% neq 0 (
    echo Error: Java not found!
    pause
    exit /b 1
)

:: 运行Maven，添加编码参数
call .mvn\apache-maven-3.9.6\bin\mvn.cmd -Dfile.encoding=UTF-8 clean package assembly:single
pause 